/*
package com.zhongkai.interceptor;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
@EnableWebMvc
@ComponentScan//组件扫描
public class CrossFilter extends WebMvcConfigurerAdapter {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        super.addCorsMappings(registry);
        System.out.println("456");
                registry.addMapping("/**")
                        .allowedHeaders("*")
                        .allowedMethods("POST","GET")
                        .allowedOrigins("http://...")
                        .allowCredentials(true);
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        System.out.println("123");
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**");
    }
}
*/
